package com.ysyx.ysyx_admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 管理员表
 * @TableName admin_inf
 */
@TableName(value ="admin_inf")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AdminPojo implements Serializable {
    /**
     * 管理员id
     */
    @TableId(type = IdType.AUTO)
    private Integer adminId;

    /**
     * 账号
     */
    private String adminAcc;

    /**
     * 密码
     */
    private String adminPwd;

    /**
     * 角色id
     */
    private Integer roleId;

    /**
     * 创建时间
     */
    private Date adminCtime;

    /**
     * 状态 1启用 0禁用
     */
    private Integer adminState;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AdminPojo other = (AdminPojo) that;
        return (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()))
            && (this.getAdminAcc() == null ? other.getAdminAcc() == null : this.getAdminAcc().equals(other.getAdminAcc()))
            && (this.getAdminPwd() == null ? other.getAdminPwd() == null : this.getAdminPwd().equals(other.getAdminPwd()))
            && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId()))
            && (this.getAdminCtime() == null ? other.getAdminCtime() == null : this.getAdminCtime().equals(other.getAdminCtime()))
            && (this.getAdminState() == null ? other.getAdminState() == null : this.getAdminState().equals(other.getAdminState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
        result = prime * result + ((getAdminAcc() == null) ? 0 : getAdminAcc().hashCode());
        result = prime * result + ((getAdminPwd() == null) ? 0 : getAdminPwd().hashCode());
        result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
        result = prime * result + ((getAdminCtime() == null) ? 0 : getAdminCtime().hashCode());
        result = prime * result + ((getAdminState() == null) ? 0 : getAdminState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", adminId=").append(adminId);
        sb.append(", adminAcc=").append(adminAcc);
        sb.append(", adminPwd=").append(adminPwd);
        sb.append(", roleId=").append(roleId);
        sb.append(", adminCtime=").append(adminCtime);
        sb.append(", adminState=").append(adminState);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}